<template lang="pug">
  table-station(title="实验楼数据" bizkey="summary" ref="tableStation"  v-bind:targetURL="targetURL"   v-bind:formModel.sync="formModel" v-on:formSubmit="formSubmit")
    div.el-form(slot="dialogFormSlot")
      input(v-model="formModel.id" type="hidden")
      el-form-item(label="项目名称" prop="proname")
        el-input(v-model="formModel.proname" )
      el-form-item(label="项目负责人" prop="areacovered")
        el-input(v-model="formModel.areacovered" )
      el-form-item(label="地址" prop="addr")
        el-input(v-model="formModel.addr" )
</template>

<script type="text/ecmascript-6">
  import {KshSummaryURL} from '../config.toml'
  import FormModel from './model'
  import TableStation from '../../../components/cascader/tableStation'
  import {baseURL} from '../../../config/global.toml'

  export default {
    name: 'kalix-ksh-summary',
    components: {TableStation},
    data() {
      return {
        fileList: [],
        targetURL: KshSummaryURL,
        formModel: Object.assign({}, FormModel),
        item: [],
        action: baseURL + '/camel/rest/upload' // http://localhost:8181/camel/rest/upload
      }
    },
    mounted() {
      this.getData()
    },
    watch: {
    },
    methods: {
      formSubmit() {
        this.getData()
      },
      getData() {
        this.axios.request({
          method: 'GET',
          url: `/camel/rest/ksh/summarys`,
          params: {}
        }).then(res => {
          this.formModel = res.data.data[0]
        })
      },
      init(dialogOption) {
      },
      getFilePath(filePath, fileName) {
        console.log('--getFilePath---', filePath)
        this.formModel.photo = filePath
        this.formModel.imgName = fileName
      }
    }
  }
</script>

<style scoped lang="stylus" type="text/stylus">

</style>
